﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class AdHM : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (null != Session["person"])
        {
            PersonClass pc = new PersonClass();
            if (pc.ishm(Session["person"].ToString()).Equals("1"))
            {
                SqlDataSource1.InsertCommand = "INSERT INTO [tb_hm] ([pid], [hmname], [hmage], [hmsex], [hmtel]) VALUES ('" + Session["person"].ToString() + "', @hmname, @hmage, @hmsex, @hmtel)";
            }
            else
            {
                Label1.Text = "<script>alert('您的权限不足！');window.location.href='Default.aspx';</script>";
            }
        }
        else
        {
            Label1.Text = "<script>alert('请登录！');window.location.href='Default.aspx';</script>";
        }
    }
}
